<?php

class IndexController extends Buzz_AuthedController {

    public function init() {
        
    }

    public function indexAction() {
        $this->view->user = Zend_Auth::getInstance()->getIdentity();
        $dbGroup = new Application_Model_GroupMapper();
        $groups = $dbGroup->findSubscribedGroups($this->view->user->id());
        $eltsByGroups = array();
        //$dbElt = new Application_Model_ElementMapper();
        
        foreach($groups as $g) {
          $eltsByGroups[$g->name()] = $dbGroup->find_element_list($g->id(), $this->session->filter);
        }
        $this->view->eltsG = $eltsByGroups;
    }

    protected function doPreDispatch() {
        return;
    }
}